#!/usr/bin/env python
# -*- coding: UTF-8 -*-

from django.contrib import admin
from models import Comment

class CommentAdmin(admin.ModelAdmin):
    fieldset = (
        (None, {'fields': (('content_type', 'object_id', 'site'), 'comment', 'is_public',)}),
        ('Comment from', {'fields': ('person_name', 'person_email', 'person_www')}),
        ('Trackback from', {'fields': ('trackback_name', 'trackback_title', 'trackback_www')}),
        ('Meta', {'fields': ('submit_date', 'ip_address', 'comment_type')}),
    )
    list_display = ('person_name', 'trackback_title', 'linkToItem', 'submit_date', 'content_type', 'get_content_object', 'is_public')
    list_display_links = ('person_name', 'trackback_title')
    list_filter = ('submit_date', 'comment_type')
    date_hierarchy = 'submit_date'
    search_fields = ('comment', 'person_name', 'trackback_title', 'trackback_name')

admin.site.register(Comment, CommentAdmin)    
